<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="keywords" th:content="${article.seoKey}">
		<meta name="description" th:content="${article.seoDesc}">
		<title th:text="${article.title}"></title>
		<link rel="icon" th:href="${@module.get('sysConfig').SITE_ICON}">
		<link th:href="${static+'/css/bootstrap.min.css'}" rel="stylesheet"/>
		<link th:href="${static+'/iconfont/iconfont.css'}" rel="stylesheet"/>
		<link th:href="${static+'/css/github-markdown.min.css'}"rel="stylesheet" />
		<link th:href="${static+'/css/blog.css'}"rel="stylesheet" />
		<script th:src="${static+'/js/jquery.min.js'}"></script>
		<script th:src="${static+'/js/bootstrap.min.js'}"></script>
		<script th:src="${static+'/js/blog.js'}"></script>
	</head>
	<body>
		<header id="header">
			<div th:replace="theme/nbclass/fragments/navbar :: navbar"></div>
		</header>
		<div class="zb-container zb-content">
			<div class="zb-main">
				<div class="article-main">
					<h3 th:text="${article.title}" class="article-title"></h3>
					<span th:text="${article.origin==1 ? '原创' : '转载'}" class="article-original"></span>
					<div class="article-meta">发布于 <span th:text="${#dates.format(article.createTime,'yyyy-MM-dd')}"></span> &nbsp;|&nbsp; <span th:text="${article.category.name}"></span> &nbsp;|&nbsp; 浏览（<span th:text="${article.lookNum}"></span>） &nbsp;|&nbsp; 评论（<span th:text="${article.commentNum}"></span>）</div>
					<hr class="hr0" />
					<div th:utext="${article.content}" class="article-body markdown-body editor-preview-active-side">
					</div>
					<div class="thumbs-content">
						<span class="thumbs-button fa fa-thumbs-up"> 点赞 <span id="loveCount" th:text="${article.supportNum}"></span></span>
						<span class="reward-button fa fa-money"> 打赏
						<p class="reward-content">
							<span class="reward-img"><img th:src="${static+'/img/weixin.jpg'}"><br>微信赞赏</span>
							<span class="reward-img"><img th:src="${static+'/img/zhifubao.jpg'}"><br>支付宝赞赏</span></p>
						<span class="reward-bottom"></span>
						<span class="reward-bottom-top"></span>
						</span>
					</div>
				</div>
				<div th:if="${article.isComment}" id="comment" class="comment comment-main">
					<div class="comment-title">发表评论</div>
					<form id="comment-form" class="form-horizontal mt-10">
						<input id="articleId" name="sid" type="hidden" th:value="${article.id}">
						<input id="avatar" name="avatar" type="hidden">
						<div id="user-name-content" class="user-name-content">欢迎您：<b id="user-name"></b><span class="save-user btn btn-sm btn-pri">保存</span></div>
						<div class="form-group" id="user-info" style="display: none">
							<div class="col-sm-4">
								<input id="nickname" type="text"  class="form-control"  name="nickname" placeholder="昵称(必填)" require="">
							</div>
							<div class="col-sm-4">
								<input id="qq" type="text" class="form-control"  name="qq" placeholder="QQ（可获取头像和昵称）">
							</div>
							<div class="col-sm-4">
								<input id="email" type="text" class="form-control"  name="email" placeholder="邮箱">
							</div>
						</div>
						<div class="form-group">
							<div class="col-xs-12">
                                <input id="comment-textarea-input" name="content" type="hidden">
								<textarea  id="comment-textarea"  class="form-control"  rows="4"  require="" placeholder="说点什么吧~"></textarea>
							</div>
						</div>
						<div><button id="submitCommentBtn" type="button" class="btn btn-pri">发表评论</button></div>
					</form>
					<hr class="hr0 mt-15"/>
					<ul id="comment-ul" class="comment">
					</ul>
				</div>
			</div>
			<div th:replace="theme/nbclass/fragments/sidebar :: sidebar"></div>
			<div class="return_top"><a class=" fa fa-arrow-up"></a></div>
		</div>
		<script>
            var sid=[[${article.id}]];
            $(function () {
                Core.postAjax("/api/article/look",{"articleId":sid})
                $(".thumbs-button").click(function () {
                    Core.postAjax("/api/article/love",{"articleId":sid},function (data) {
                        if(data.status==200){
                            $("#loveCount").text(parseInt($("#loveCount").text())+1);
                        }else{
                            Core.msg(data.msg,2)
                        }
                    });
                })
            })
		</script>
		<script th:if="${article.isComment}" th:src="${static+'/js/comment.js'}"></script>
	</body>

</html>